package main

import (
	"net/http"
	"imooc.com/crawler/frontend/controller"
)

 func main() {
	//除了下面的search，其他都访问文件,如果目录下有index,则默认只因为index.html
	http.Handle(`/`, http.FileServer(
		http.Dir("crawler/frontend/view")))

	http.Handle("/search",
		controller.CreateSearchResultHandler(
			"crawler/frontend/view/template.html"))
	err := http.ListenAndServe(":8888", nil)
	if err != nil {
		panic(err)
	}

}
